From: Florian Müllner Date: Wed, 3 Aug 2022 16:12:31 +0000 (+0200) Subject: status/network: Add timestamp to device items X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~461^2^2~82 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=cb4d96072e454ff178e636e93ec2ee3e0a814384;p=gnome-shell.git status/network: Add timestamp to device items Devices do not have an associated timestamp, but as we can now track the MRU order of their connections, it makes sense to consider the time of the most recent succesful connection the timestamp of the device item. Part-of: --- diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 66c65b434..d1b4baba3 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -437,7 +437,7 @@ const NMDeviceItem = GObject.registerClass({ this._deviceName = ''; this._connectionItems = new Map(); - this._itemSorter = new ItemSorter(); + this._itemSorter = new ItemSorter({trackMru: true}); // Item shown in the 0-connections case this._autoConnectItem = @@ -470,6 +470,11 @@ const NMDeviceItem = GObject.registerClass({ this._activeConnectionChanged(); } + get timestamp() { + const [item] = this._itemSorter.itemsByMru(); + return item?.timestamp ?? 0; + } + _canReachInternet() { if (this._client.primary_connection !== this._device.active_connection) return true;